package com.atguigu.tingshu.user.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

@Component
public class A {
//    @Autowired
//    private B b;
    private B b;
    @Autowired //setter方法注入
    @Lazy
    public void setB(B b){
        this.b = b;
    }

//    public A(B b){
//        this.b = b;
//    }
    public B getB(){
        return this.b;
    }
}
